<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CEE7FF" style="border-collapse:collapse">
	<tr>
		<td width="20%" class="bbgg">
			<strong>臂章名称</strong>
		</td>
		
		<td width="20%" class="bbgg">
			<strong>操 作</strong>
		</td>
	</tr>	
	<?php foreach ($this->badge as $v):?>
	<tr>
		<td width="20%" height="20">
			<?php echo $v->badge_name;?>
		</td>
		
		<td width="20%" align="center">
			<a href="administrator-badge-edit?id=<?php echo $v->badge_id;?>">编辑</a>
			<a href="javascript:void(0)" onclick="delete_badge(<?php echo $v->badge_id;?>, this)">删除</a>
		</td>
	</tr>		
	<?php endforeach;?>															
</table>
<script type="text/javascript">
	function delete_badge(id, obj)
	{
		if (confirm('确认删除？')) {
			$.ajax({
				type: "GET",
				url: "administrator-badge-delete?id="+id,
				success: function(data) {
					switch(data) {		
						case "0":
							alert('删除失败');
							break;
						case "1":
							alert('删除成功');
							$(obj).parent().parent().remove();
							break;	
						default:
							break;			
					}
				}			
			});
		}
	}
</script>